package com.hit.core.exception.enums;

import com.hit.core.annotion.ExpEnumType;
import com.hit.core.consts.ExceptionConstant;
import com.hit.core.factory.ExceptionCodeFactory;

@ExpEnumType(module = ExceptionConstant.CORE_MODULE_CODE, kind = ExceptionConstant.PARAM_EXCEPTION_CODE)
public enum ParamExceptionEnum implements AbstractBaseExceptionEnum {
    PARAM_ERROR(1, "参数错误");

    private final Integer code;

    private final String message;

    ParamExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return ExceptionCodeFactory.getExceptionCode(this.getClass(), code);
    }

    @Override
    public String getMessage() {
        return message;
    }

}
